package com.ingsing.tourism.service.Impl;

import com.ingsing.tourism.entity.User;
import com.ingsing.tourism.mapper.IUserMapper;
import com.ingsing.tourism.service.IUserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Date;


/**
 * @Author houg
 * @create 2019/10/15 00:35
 * @explain
 */
@Service
public class UserServiceImpl implements IUserService {
    @Resource
    private IUserMapper userMapper;

    @Override
    public User selectByUsername(String username ) {
        return userMapper.selectByUsername(username);
    }

    @Override
    public User selectByEmail(String email ) {
        return userMapper.selectByEmail(email);
    }

    @Override
    public User selectByPhone(String phone ) {
        return userMapper.selectByPhone(phone);
    }

    @Override
    public int insertSelective(User user) {
        return userMapper.insertSelective(user);
    }

    @Override
    public int updateUser(User user) {
        return userMapper.updateByPrimaryKeySelective(user);
    }

    @Override
    public int offAccount(Integer userId) {
        return userMapper.offAccount(userId);
    }

    @Override
    public int disableAccount(Integer userId) {
        return userMapper.disableAccount(userId);
    }

    @Override
    public int abnormalAccount(Integer userId) {
        return userMapper.abnormalAccount(userId);
    }

    @Override
    public int setLastLogin(User user) {
        return userMapper.updateByPrimaryKey(user);
    }


}
